Repository navigation
Verify the Postgres server certificate - #7
Merged
Merged
Conversation
Stalwart connected to Postgres with allowInvalidCerts, so any certificate was accepted (infra#94). infra now signs the server certificate with an internal CA and publishes ConfigMap ca-bundle: Debian's public roots plus that CA. Stalwart's rustls verifier reads the trust store from SSL_CERT_FILE when it is set, and then ignores the system store. That verifier also checks outbound SMTP, ACME and OIDC, so the file must hold the public roots too, which is why it is ca-bundle and not the internal CA alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Часть 2 из 3 для bulbashenko-com/infra#94.
config.json:allowInvalidCerts: falseдля DataStore PostgreSql.ca-bundle(публичные корни Debian и внутренний CA, раскладывает trust-manager) монтируется в/etc/ca-bundle,SSL_CERT_FILEуказывает на него.Почему не только внутренний CA: Stalwart (v0.16.23,
crates/utils/src/tls.rs) проверяет TLS черезrustls-platform-verifier, а на Linux он черезrustls-native-certsберётSSL_CERT_FILEвместо системного хранилища. Этим же верификатором (pki_verify) проверяется исходящая SMTP-доставка, поэтому в файле нужны и публичные корни.Draft, пока не live bulbashenko-com/infra#130. У Stalwart стратегия
Recreate: если выкатить это раньше, под не стартует (нет ConfigMap) или не подключится к базе (сертификат ещё от CA CNPG), и почта ляжет. Deploy PRdeploy/mailмержить только после #130.Проверка после деплоя: под Ready, в логах нет TLS-ошибок к Postgres, тестовое письмо наружу и внутрь.
🤖 Generated with Claude Code